/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2012
 */

package com.tech15.pub.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.tech15.core.model.Attach;
import com.tech15.pub.model.*;
import com.tech15.pub.dao.*;
import com.tech15.pub.service.*;
import com.tech15.pub.vo.query.*;

/**
 * @author 胡作正 email:zuozhenghu@sina.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "PUB_CCSQ")
public class PubCcsq extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "出差申请";
	public static final String ALIAS_ID = "序号";
	public static final String ALIAS_YGBH = "员工编号";
	public static final String ALIAS_YGXM = "员工姓名";
	public static final String ALIAS_BM = "部门";
	public static final String ALIAS_ZYFZCJ = "职业发展层级";
	public static final String ALIAS_CCLY = "出差理由";
	public static final String ALIAS_CCLX = "出差类型";
	public static final String ALIAS_SPR = "审核人";
	public static final String ALIAS_USERID = "用户名";
	public static final String ALIAS_SHYJ = "审核意见";
	public static final String ALIAS_ZT = "状态（0待审核 1关闭 2审核通过 3退回）";
	public static final String ALIAS_TJSJ = "提交时间";
	public static final String ALIAS_SHSJ = "审核时间";
	
	//date formats
	public static final String FORMAT_TJSJ = DATE_TIME_FORMAT;
	public static final String FORMAT_SHSJ = DATE_TIME_FORMAT;
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 序号       db_column: ID 
     */ 	
	@Length(max=32)
	private java.lang.String id;
    /**
     * 员工编号       db_column: YGBH 
     */ 	
	@Length(max=30)
	private java.lang.String ygbh;
    /**
     * 员工姓名       db_column: YGXM 
     */ 	
	@Length(max=30)
	private java.lang.String ygxm;
    /**
     * 部门       db_column: BM 
     */ 	
	@Length(max=60)
	private java.lang.String bm;
    /**
     * 职业发展层级       db_column: ZYFZCJ 
     */ 	
	@Length(max=30)
	private java.lang.String zyfzcj;
    /**
     * 出差理由       db_column: CCLY 
     */ 	
	@Length(max=800)
	private java.lang.String ccly;
    /**
     * 出差类型       db_column: CCLX 
     */ 	
	@Length(max=30)
	private java.lang.String cclx;
    /**
     * 审核人       db_column: SHR 
     */ 	
	
	private Long spr;
    /**
     * 用户名       db_column: USERID 
     */ 	
	
	private Long userid;
    /**
     * 审核意见       db_column: SHYJ 
     */ 	
	@Length(max=300)
	private java.lang.String shyj;
    /**
     * 状态（0待审核 1关闭 2审核通过 3退回）       db_column: ZT 
     */ 	
	@Max(127)
	private Integer zt;
    /**
     * 提交时间       db_column: TJSJ 
     */ 	
	
	private java.util.Date tjsj;
    /**
     * 审核时间       db_column: SHSJ 
     */ 	
	
	private java.util.Date shsj;
	//columns END


	public PubCcsq(){
	}

	public PubCcsq(
		java.lang.String id
	){
		this.id = id;
	}

	

	public void setId(java.lang.String value) {
		this.id = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "uuid.hex")
	@Column(name = "ID", unique = true, nullable = false, insertable = true, updatable = true, length = 32)
	public java.lang.String getId() {
		return this.id;
	}
	
	@Column(name = "YGBH", unique = false, nullable = true, insertable = true, updatable = true, length = 30)
	public java.lang.String getYgbh() {
		return this.ygbh;
	}
	
	public void setYgbh(java.lang.String value) {
		this.ygbh = value;
	}
	
	@Column(name = "YGXM", unique = false, nullable = true, insertable = true, updatable = true, length = 30)
	public java.lang.String getYgxm() {
		return this.ygxm;
	}
	
	public void setYgxm(java.lang.String value) {
		this.ygxm = value;
	}
	
	@Column(name = "BM", unique = false, nullable = true, insertable = true, updatable = true, length = 60)
	public java.lang.String getBm() {
		return this.bm;
	}
	
	public void setBm(java.lang.String value) {
		this.bm = value;
	}
	
	@Column(name = "ZYFZCJ", unique = false, nullable = true, insertable = true, updatable = true, length = 30)
	public java.lang.String getZyfzcj() {
		return this.zyfzcj;
	}
	
	public void setZyfzcj(java.lang.String value) {
		this.zyfzcj = value;
	}
	
	@Column(name = "CCLY", unique = false, nullable = true, insertable = true, updatable = true, length = 800)
	public java.lang.String getCcly() {
		return this.ccly;
	}
	
	public void setCcly(java.lang.String value) {
		this.ccly = value;
	}
	
	@Column(name = "CCLX", unique = false, nullable = true, insertable = true, updatable = true, length = 30)
	public java.lang.String getCclx() {
		return this.cclx;
	}
	
	public void setCclx(java.lang.String value) {
		this.cclx = value;
	}
	
	@Column(name = "SPR", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getSpr() {
		return this.spr;
	}
	
	public void setSpr(Long value) {
		this.spr = value;
	}
	
	@Column(name = "USERID", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getUserid() {
		return this.userid;
	}
	
	public void setUserid(Long value) {
		this.userid = value;
	}
	
	@Column(name = "SHYJ", unique = false, nullable = true, insertable = true, updatable = true, length = 300)
	public java.lang.String getShyj() {
		return this.shyj;
	}
	
	public void setShyj(java.lang.String value) {
		this.shyj = value;
	}
	
	@Column(name = "ZT", unique = false, nullable = true, insertable = true, updatable = true, length = 2)
	public Integer getZt() {
		return this.zt;
	}
	
	public void setZt(Integer value) {
		this.zt = value;
	}
	
	@Transient
	public String getTjsjString() {
		return DateConvertUtils.format(getTjsj(), FORMAT_TJSJ);
	}
	public void setTjsjString(String value) {
		setTjsj(DateConvertUtils.parse(value, FORMAT_TJSJ,java.util.Date.class));
	}
	
	@Column(name = "TJSJ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getTjsj() {
		return this.tjsj;
	}
	
	public void setTjsj(java.util.Date value) {
		this.tjsj = value;
	}
	
	@Transient
	public String getShsjString() {
		return DateConvertUtils.format(getShsj(), FORMAT_SHSJ);
	}
	public void setShsjString(String value) {
		setShsj(DateConvertUtils.parse(value, FORMAT_SHSJ,java.util.Date.class));
	}
	
	@Column(name = "SHSJ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getShsj() {
		return this.shsj;
	}
	
	public void setShsj(java.util.Date value) {
		this.shsj = value;
	}
	
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Ygbh",getYgbh())
			.append("Ygxm",getYgxm())
			.append("Bm",getBm())
			.append("Zyfzcj",getZyfzcj())
			.append("Ccly",getCcly())
			.append("Cclx",getCclx())
			.append("Userid",getUserid())
			.append("Shyj",getShyj())
			.append("Zt",getZt())
			.append("Tjsj",getTjsj())
			.append("Shsj",getShsj())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof PubCcsq == false) return false;
		if(this == obj) return true;
		PubCcsq other = (PubCcsq)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
	
	List<Attach> attach;
	
	
	@Transient
	public List<Attach> getAttach() {
		return attach;
	}

	public void setAttach(List<Attach> attach) {
		this.attach = attach;
	}
}

